//
//  MBBaseServer.h
//  MBObjectServer
//
//  Created by admin on 3/3/14.
//  Copyright (c) 2014 MBpayer. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBBaseHttpClient.h"
#import "SVProgressHUD.h"
//声明配置信息
#define kOrgCode @"OrgCode"
#define kOwnerOrgCode @"OwnerOrgCode"
#define kUserID @"UserID"
#define kUserName @"UserName"
#define kShopID @"ShopID"
#define kAgentID @"AgentID"
#define kShopName @"ShopName"
#define kIMEI @"IMEI"
#define kCashCode @"CashCode"
#define kCashierID @"CashierID"
#define kCashierTeamID @"CashierTeamID"
#define kCashSale @"CashSale"
#define kCardSale @"CardSale"
#define kVoucherSale @"VoucherSale"
#define kVoucher2Sale @"Voucher2Sale"
#define kOtherSale @"OtherSale"
#define kSumTotal @"SumTotal"
#define kVIPCode @"VIPCode"
#define kVIPID @"VIPID"
#define kOwnerOrgCode @"OwnerOrgCode"
#define kAllOrderOff @"AllOrderOff"//整单折扣
#define kRemark @"Remark"//折扣原因
#define kRemarkCode @"RemakrCode"//折扣原因编号
#define kdiscountRate2 @"discountRate2" //折上折
#define kdiscountremark @"discountremark" //折上折原因
#define kIsWholeOrder @"IsWholeOrder"//是否是整单
#define kallPayStr @"AllPayStr"//订单总金额
#define krealPayStr @"RealPayStr"//打折券金额
#define kticketStr @"TicketStr"//实付总金额

#define kmemberName @"memberName"//会员名称
#define kmemberScore @"memberScore"//会员积分
#define kmemberTicket @"memberTicket"//会员券数

typedef  void (^ReceiveSuccess) (NSDictionary *dicReceiveData);
typedef  void (^ReceiveArrSuccess) (NSArray *arrReceiveData);
typedef  void (^ReceiveFailure) (NSError *error);
@protocol MBBaseServerDelegate <NSObject>

-(void)receiveData:(NSDictionary *)dic WithPath:(NSString *)path;
@optional
-(void)FailureData:(NSString *)path WithError:(NSError *)error;
@end

@interface MBBaseServer : NSObject<MBBaseHttpClientDelegate>{
    MBBaseHttpClient * baseclient;
    NSString *paths;
}
@property(strong,nonatomic)MBBaseHttpClient * baseclient;
@property(strong ,nonatomic)NSString *str;
//@property(strong,nonatomic)NSString * paths;
@property(strong) id<MBBaseServerDelegate> delegate;
@property BOOL isStartLoad,isDismiss;
- (void)setRequestStyle:(NSString*)style andSetPathString:(NSString*)path andSetHeadString:(NSString*)head andActionName:(NSString*)action andSetMainDictionary:(NSMutableDictionary*)dictionary;
    
- (void)setRequestStyle:(NSString*)style andSetPathString:(NSString*)path andSetHeadString:(NSString*)head andActionName:(NSString*)action andSetMainDictionary:(NSMutableDictionary*)dictionary block:(void(^)(NSDictionary * responseData))processResult failblock:(void(^)(NSError *error))failresult;
- (void)setRequestMBStyle:(NSString*)style andSetPathString:(NSString*)path andSetHeadString:(NSString*)head andActionName:(NSString*)action andSetMainDictionary:(NSMutableDictionary*)dictionary  block:(void(^)(NSDictionary * responseData))processResult failblock:(void(^)(NSError *error))failresult;
@end
